i'm using react twilio-chat package for twlio conversation (chat). when I try to create client it throws this error Error: Fetch resource from "Client/v1/Configuration" failed.
this is the decoded token I am passing in it
"jti": "SK0cXXXXXXXXXXXXXXXXXXXXXX",
"grants": {
"identity": "agent@gmail.com",
"chat": {
"service_sid": "ISaXXXXXXXXXXXXXXXXXXXXXX"
},
"data_sync": {
"service_sid": "default"
}
},
"iat": 1638XXXX,
"exp": 1638XXXX,
"iss": "SK0c3XXXXXXXXXXXXXXXXXXXXXX",
"sub": "AC769XXXXXXXXXXXXXXXXXXXXXX"
}
here is the code
import { Client } from "twilio-chat";
import React, { Component } from "react";
var chatClient = {};
try {
chatClient = await Client.create(clientToken?.value?.data?.token);
} catch (error) {
console.log("Chat Client Error ", error);
}
Thanks in advance
Twilio developer evangelist here.
I believe the @ symbol is a reserved character and should not be used for identities within Twilio Chat. Try an identity that doesn't use the @ symbol.
There was an error in token side. therefore the token did not contain the proper configuration. thanks for the help.